/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package warmachinesystem.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import warmachinesystem.TBPointCostDelta;
import warmachinesystem.WarmachineSystemPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>TB Point Cost Delta</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link warmachinesystem.impl.TBPointCostDeltaImpl#getPointCostDelta <em>Point Cost Delta</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class TBPointCostDeltaImpl extends BaseUnitTierElementImpl implements TBPointCostDelta {
	/**
	 * The default value of the '{@link #getPointCostDelta() <em>Point Cost Delta</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPointCostDelta()
	 * @generated
	 * @ordered
	 */
	protected static final int POINT_COST_DELTA_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getPointCostDelta() <em>Point Cost Delta</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPointCostDelta()
	 * @generated
	 * @ordered
	 */
	protected int pointCostDelta = POINT_COST_DELTA_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected TBPointCostDeltaImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return WarmachineSystemPackage.Literals.TB_POINT_COST_DELTA;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getPointCostDelta() {
		return pointCostDelta;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPointCostDelta(int newPointCostDelta) {
		int oldPointCostDelta = pointCostDelta;
		pointCostDelta = newPointCostDelta;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WarmachineSystemPackage.TB_POINT_COST_DELTA__POINT_COST_DELTA, oldPointCostDelta, pointCostDelta));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WarmachineSystemPackage.TB_POINT_COST_DELTA__POINT_COST_DELTA:
				return getPointCostDelta();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WarmachineSystemPackage.TB_POINT_COST_DELTA__POINT_COST_DELTA:
				setPointCostDelta((Integer)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case WarmachineSystemPackage.TB_POINT_COST_DELTA__POINT_COST_DELTA:
				setPointCostDelta(POINT_COST_DELTA_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WarmachineSystemPackage.TB_POINT_COST_DELTA__POINT_COST_DELTA:
				return pointCostDelta != POINT_COST_DELTA_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (pointCostDelta: ");
		result.append(pointCostDelta);
		result.append(')');
		return result.toString();
	}

} //TBPointCostDeltaImpl
